package com.cdn.nodes.api;


import com.cdn.common.core.constant.ServiceNameConstants;
import com.cdn.common.core.domain.R;
import com.cdn.nodes.api.factory.RemoteNodeFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

@FeignClient(contextId = "remoteNodeService",
        value = ServiceNameConstants.NODE_SERVICE,
        fallbackFactory = RemoteNodeFallbackFactory.class)
public interface RemoteNodeService {

    /**
     * 根据节点Id获取DNS线路
     */
    @GetMapping("/nodeInfo/getDnsLineByNodeId/{nodeId}")
    public R<String> getDnsLineByNodeId(@PathVariable("nodeId") Long nodeId);

    /**
     * 根据节点Ids获取DNS线路
     */
    @GetMapping("/nodeInfo/getNodeLine/{nodeId}")
    public R<List<String>> getNodeLine(@PathVariable("nodeId") Long[] nodeId);
}
